<table class="border13" style="width:100%;" cellspacing="5">
<tr>
<td style="width:20%;font-size:10pt;">
        <a href="{url link='public.event.calendar' month=$iPrevMonth|date_format:'%m' year=$iPrevMonth|date_format:'%Y'}">
        &lt;&lt; {$iPrevMonth|date_format:'%B %Y'}  
        </a>
</td><td style="width:60%;font-size:13pt;text-align:center;">
<b>{$iCurrentMonth|date_format:'%B %Y'}</b>
</td><td style="width:20%;font-size:10pt;text-align:right;">
        <a href="{url link='public.event.calendar' month=$iNextMonth|date_format:'%m' year=$iNextMonth|date_format:'%Y'}">
        {$iNextMonth|date_format:'%B %Y'} &gt;&gt;
        </a>
</td>
</tr>
</table>
    <table style="width:100%;" cellpadding="5" cellspacing="0">
    <tr>
        <td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="sunday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="monday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="tuesday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="wednesday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="thursday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="friday"}</td><td style="width:14%;font-size:9pt;" class="mainmenu5">{language text="saturday"}</td>
    </tr>
{foreach from=$aCalendar item=aWeek name=acalendar}
    <tr>
{foreach from=$aWeek key=iDay item=mDay name=aweek}
{if $iDay == ''}
    <td colspan="{$mDay}"> </td>
{else}
    <td {if $iCurrentDay != $iDay} onmouseover="getElementById('fox_{$iDay}').className='mainmenu5';" onmouseout="getElementById('fox_{$iDay}').className='';"{/if} style="height:150px;vertical-align:top;cursor:pointer;font-size:8pt;" class="{cycle values='border13,border2'}" onclick="window.location.href='{url link='public.event.day' month=$iCurrentMonth|date_format:'%m' year=$iCurrentMonth|date_format:'%Y' day=$iDay}'">
    <div class="{if $iCurrentDay == $iDay}mainmenu5{/if}" style="padding:4px;" id="fox_{$iDay}">{$iDay}</div> <br />
    <div style="padding:4px;">
{if $mDay != 0}
{assign var='i' value=0}
{foreach from=$mDay item=aEvent name=aevents}
{assign var='i' value=$i+1}
{if $i < $iMaxCount}
        <div>
            <a href="{url link='public.event.view' id=$aEvent.id}">{$aEvent.title|escape}</a>
        </div>
{elseif $i == $iMaxCount}
        <br />
        <div style="text-align:right;">[<a href="{url link='public.event.day' month=$iCurrentMonth|date_format:'%m' year=$iCurrentMonth|date_format:'%Y' day=$iDay}">{language text="view_all"}</a>]
{/if}
{/foreach}
{/if}
    </div>
    </td>
{/if}
{/foreach}
    </tr>
{/foreach}
    </table>